home *** CD-ROM | disk | FTP | other *** search
/ 130 MIDI Tool Box / 130 MIDI Tool Box.iso / midimod1 / midimod.doc < prev    next >
Text File  |  1993-04-13  |  18KB  |  326 lines

  1. MIDIMOD - Amiga Noise/Sound/Protracker to MIDI file converter
  2. (c)opyright Andrew Scott 1993
  3.  
  4. MIDIMOD - What it does
  5. ----------------------
  6. MIDIMOD is a program which converts music modules generated by Amiga tracker
  7. programs (MOD files) to general MIDI format 1 (MID files). It is menu-
  8. driven and if not "user-friendly", at least "user-polite". No temporary
  9. files are created at any stage, so it is ok to be run on a floppy (though
  10. a disk-cache utility or a fast drive are preferred). Some editting of the
  11. output MID file will probably be necessary, but only to normalise volumes.
  12.  
  13. Why convert MOD files to MID files?
  14. -----------------------------------
  15. Even though MOD files contain some music-instructions that cannot be
  16. represented in MID format, there are many reasons why it is desirable to
  17. have music in MID form rather than MOD form:
  18.   *  Some sound cards cannot play MOD files, only MID files (eg. Ad Lib)
  19.   *  Top-of-the-range music editting programs do not handle MOD files, but
  20.      almost always handle MID files
  21.   *  There exist programs to print out MID files as musical score. I don't
  22.      know of any which do the same for MOD files
  23.   *  MID files tend to be much smaller than MOD files
  24.   *  On some sound cards, MID files sound better than MOD files (although
  25.      on many others the converse is true)
  26.   *  MID files are more portable, having a well-known format, and have
  27.      utilities on many different computers. MID files _ARE_ the industry
  28.      standard.
  29.   *  MID files can be played on professional keyboards, allowing expert
  30.      recording/presentation of music
  31.   *  Umm.. Microsoft Windows comes with a MID player but not a MOD player,
  32.      so you can play MID files as a background task (and insert MID files
  33.      into documents etc. etc.)
  34. Ok.. have I sold you on MOD->MID conversion yet?
  35.  
  36. How to use MIDIMOD
  37. ------------------
  38. After starting up MIDIMOD (I assume you know how to do that), you can
  39. select menus and commands by simply pressing a key. There are 3 menus:
  40.   * File menu (press "F"): commands to do with files
  41.   * Samples menu (press "S"): commands to do with samples
  42.   * Help menu (press "H"): commands to do with help
  43. You can also use the cursor keys to select menus and commands, and then
  44. press <RETURN> to select that command.
  45.  
  46. The File Menu
  47. -------------
  48. The file menu consists of 4 commands:
  49.   * Destination MIDI file (press "D"): A dialogue box will appear and ask
  50.       you to enter the name of a MID file. After entering the full name
  51.       (including extension eg. TECHNO.MID) press <RETURN>. If the file
  52.       you entered already exists then you will be asked if it can be
  53.       overwritten.. press "Y" for yes or "N" for no.
  54.   * Source MOD file (press "S"): A dialogue box will appear similar to the
  55.       "Destination MIDI" one. Enter a filename then press <RETURN>
  56.   * Convert (press "C"): This will convert the MOD file you entered to the
  57.       MID file you entered. I suggest before you do this step, use the
  58.       Sample menu to set samples to appropriate instruments. Sometimes
  59.       conversion takes a while - please be patient. If you get an error
  60.       message which says that you have too many different instruments, then
  61.       use the "Map samples" command to reduce the number.
  62.   * Quit (press "Q"): Yep.. you quit MIDIMOD if you choose this command.
  63.  
  64. The Samples Menu
  65. ---------------
  66. The samples menu consists of 2 commands:
  67.   * Map samples (press "M"): There are many, many MOD samples on computers
  68.       around the world, so it is impossible to automatically know which
  69.       instrument is equivalent to which sample. You must tell MIDIMOD which
  70.       instrument to use. Use the cursor keys and <RETURN> to select a
  71.       sample from the list that appears on the screen. It is possible that
  72.       the list will be longer than the screen and so you will need to move
  73.       off the bottom of the list (don't worry.. the list will scroll upwards
  74.       if it can). If you can't move off the top/bottom of the list, you
  75.       will hear a beep. Each sample may have an asterisk "*" before it -
  76.       this means that there is actual sample data that corresponds to this
  77.       sample - ignore any other samples.. they won't be converted (except
  78.       in name only). Each sample will have an instrument code to its right.
  79.       If the code is prefixed by a "D" then it is a percussion code. Anyway..
  80.       after selecting a sample, a list of all of the available instruments
  81.       will appear on the screen (it is another scrolling menu). Select one
  82.       and the appropriate code will appear to the right of it. If you
  83.       don't want to select anything from a menu, just press <ESCAPE>. So
  84.       when all samples have been given instruments (sometimes they will
  85.       already have an instrument code.. it is best to leave these codes as
  86.       they already have been matched with a sample's name) press <ESCAPE>
  87.   * Transposing (press "T"): Even if you have matched a MOD sample with a
  88.       MIDI instrument there is no guarantee that each will play at the same
  89.       pitch. MOD samples tend to sound high, low, very low, or slightly off
  90.       pitch when both MOD and MIDI instruments play the same note. The trick
  91.       is to map MOD samples to a different note during the conversion, so
  92.       that there won't be any horrible musical clashes. A good way to do
  93.       this is to find a sample that maps exactly to a MIDI instrument, and
  94.       then get a MOD-editor and play other samples, and compare those
  95.       samples to the "true" sample. This way you can find the number of
  96.       semitones difference there are between a MOD sample and its instrument
  97.       equivalent. For example, bass guitar samples are usually an octave
  98.       lower (sometimes two) than their actual note. As an octave is 12
  99.       semitones, if the guitar sample is transposed down 12 semitones, it
  100.       sounds ok. Another example, chords are usually made up of 3 notes
  101.       which are played simulateously (major chords have part of them
  102.       transposed up 4 semitones, and another part 7 semitones where minor
  103.       chords have 3 and 7 semitone transposed parts). After selecting
  104.       a MOD-sample from the menu (the numbers on the right are the
  105.       transpose values), you can enter in its transposition. For a bass
  106.       sample you might enter:
  107.         -12
  108.       then press <RETURN>, whereas for a major chord you might enter
  109.         0, 4, 7
  110.       then press <RETURN>, and for a bass major chord you might enter
  111.         -12, -8, -5
  112.       then press <RETURN> (note than -12+4=-8 etc.). During conversion,
  113.       these transpositions are applied and hopefully the MID-file won't
  114.       sound as if many musicians are playing using different scales. A
  115.       couple of things you need to watch out for: if one of the transposition
  116.       values is 0 then it must be the first value, also don't transpose
  117.       percussion instruments - it's not a good idea.
  118.   * Save info (press "S"): Because it is nicer to have the computer
  119.       select instruments and transpositions for you than having to look
  120.       them up each time, MIDIMOD keeps a list of "known" mappings/transposes
  121.       from MOD-samples to MID-instruments. Once you have selected a mapping
  122.       using the "Map samples" command or a transposition using "Transposing",
  123.       you can use this command to save a sample's info to the info file.
  124.       Just select the sample with the cursor keys and <RETURN> and it is
  125.       done. Press <ESCAPE> to leave this command.
  126.  
  127. The Help Menu
  128. -------------
  129. There is only 1 command in the help menu:
  130.   * About (press "A"): This displays some information about MIDIMOD. Press
  131.       any key to make it go away.
  132. If you really wanted help.. print out this document and use it as a reference
  133. while you use MIDIMOD. If you are still stuck, call up a friend who knows
  134. a bit about computers and ask them what to do (but you were going to do that
  135. anyway weren't you?).. it may help if they know something about music too.
  136. Maybe get in contact with a hacker-friend and a muso-friend. On the other
  137. hand, maybe it would be best to throw a party and invite all your friends
  138. around.
  139.  
  140. Command Line Parameters
  141. -----------------------
  142. When executing MIDIMOD, you can put the two filenames on the command-line
  143. eg. midimod headbang.mod techno.mid
  144. The first filename (you guessed it) is the MOD file, and the second is the
  145. MID file. If the MID-file already exists, then you will be asked if you
  146. really want to overwrite it.
  147.  
  148. Example Session
  149. ---------------
  150. Ok.. just incase everything I have said so far has gone over your head, here
  151. is the way that I use the program (and it works for me.. honest!):
  152.   * Run MIDIMOD by typing "MIDIMOD" at the command-line and press <RETURN>
  153.   * Press "F" followed by "S" to choose the "Source MOD file" command.
  154.   * Enter the MOD file name (eg. headbang.mod) and press <RETURN>
  155.   * Press "D" to choose the "Destination MIDI file" command.
  156.   * Enter the MID file name (eg. techno.mid) and press <RETURN>
  157.   * Press either: the right cursor key, or
  158.                   <ESCAPE> followed by "S"
  159.     Then press "M" to choose the "Map Samples" command.
  160. --1--
  161.   * Now use the up cursor key and the down cursor key to highlight a sample,
  162.     then press <RETURN> to select it. Remember, only the samples with a "*"
  163.     on the left-hand side are actually samples, the rest are probably just
  164.     advertising.
  165.   * Now use the up cursor key and the down cursor key to highlight an
  166.     instrument (you should be getting quite good at this now) then press
  167.     <RETURN> to select it. If the sample was percussion, you should've
  168.     selected a percussion instrument (the ones with a "D" on the left).
  169.   * Go back to --1-- and do these steps until you get sick of them, or
  170.     all of the proper samples have been allocated an instrument
  171.   * Press <ESCAPE> to quit from this command
  172.   * Press either: the left cursor key, or
  173.                   <ESCAPE> followed by "F"
  174.     Then press "C" to choose the "Convert" command.
  175.   * Wait for the disk to stop writing, and the cursor to reappear.
  176.   * Press "Q" to choose the "Quit" command.
  177. There should now be a file lying around called "techno.mid" or whatever
  178. you typed in. This is the MIDI equivalent to the MOD file.
  179.  
  180. The Instruments
  181. ---------------
  182. The list of MIDI instruments is kept in the text file "midimod.ins". Each
  183. instrument separate line. The first 128 lines must hold the instruments
  184. 0 to 127. The lines after this hold the percussion instruments (no more than
  185. 128). All instruments should have a code as the first thing on the line.
  186. The code must consist of the letter "D" (only if it is a percussion
  187. instrument) followed by a number from 0 to 127. This file can be editted
  188. with a text editor to put in the instruments for your particular soundcard/
  189. computer/keyboard/software etc. The supplied instrument file contains the
  190. Soundblaster MIDI patches, if you are using a synth or a different sound
  191. card, then edit this file and insert the correct instruments for you.
  192.  
  193. The Info File
  194. -------------
  195. A list of default mappings and transpositions is kept in the text file
  196. "midimod.map". This is maintained with the "Save info" command in the
  197. "Samples" menu, but it can also be editted with a text-editor. Each
  198. sample is on a separate line, and consists of the first word in the sample's
  199. name followed by 4 numbers, all separated by spaces. The first word in the
  200. sample's name comes right after any header (st-xx: or leading spaces) and
  201. terminates at the first space. The first number is a mapping number, the
  202. remaining three numbers are transposition values (normally 0 0 0). The
  203. mapping numbers range from 0 to 255. The numbers 0-127 correspond to the
  204. MIDI instruments 0-127, and the other mapping numbers are the percussion
  205. instrument codes plus 128 (without the "D" infront). The transposition
  206. values hold either a set amount to transpose the instrument by (first
  207. transposition value) or a mapping to a chord (two or more non-zero numbers).
  208. Any 0 transposition value must occur in the first position. Each line in
  209. the info file is in alphabetical order, and it would be a bad idea to put
  210. a sample in the wrong place.
  211.  
  212. All of the mapping/transpositions in the supplied "midimod.map" file are
  213. for the soundblaster card (preferrably running windows). If none of the
  214. info applies to you, you can delete the file and replacing it with the
  215. "blank.map" file provided. It is probably better to note down some of the
  216. info in the given "midimod.map", as even if mappings are wrong, transpose
  217. values will still apply.
  218.  
  219. What is this .mm file?
  220. ----------------------
  221. Because there are some times when you don't want to store information about
  222. a MOD file in the info file, a file with the same name as the MOD-file
  223. except with a .mm extension is created. This .mm file holds all of the
  224. information that you have entered about the MOD-file. It is automatically
  225. read in when you load the MOD file, and automatically saved when you quit.
  226. It is read in just before checking the info file (above), and so if you
  227. have added any new sample info that applies to that particular MOD-file
  228. it will be included. You can safely delete the .mm file, but it will come
  229. back next time you using that MOD-file.
  230.  
  231. Notes on Conversion
  232. -------------------
  233. Firstly, the way the algorithm works, each different instrument is allocated
  234. a different channel (this makes later editting of the MID file _MUCH_
  235. easier). As there are only 16 different channels this causes a bit of a
  236. problem when you have a MOD file with 31 different samples. All is not lost
  237. due to the nature of MOD files. Each percussion instrument can be put on
  238. the same channel (10), giving you unlimited percussion instruments but 15
  239. channels for the other instruments. If the MOD file you are using has more
  240. than 15 completely different non-percussion samples then it is an unusual
  241. MOD file indeed.
  242.  
  243. There is also some ambiguity with regard to multiple notes of the same
  244. pitch on the same channel in the MIDI format. The MOD format can handle
  245. it if the notes are on different channels, but if they are the same sample
  246. then MIDIMOD will map them to the same channel in MIDI format. Some MIDI
  247. players allow "overlapping" notes, some don't - I was going to automatically
  248. remove "overlapped" notes, but no MIDI-player that I have chucks a fit if
  249. they are in, so they are still there. Cross your fingers and everything
  250. should sound fine.
  251.  
  252. You will almost definitely need to edit the resulting MID file, as such
  253. things as volume are very dependant on hardware and software. Also, some
  254. samples may not be recognised by MIDIMOD and may need transposing otherwise
  255. the tune might sound horrible.. but as soon as you find correct transpose
  256. details, feed them back into MIDIMOD so it can recognise them next time.
  257.  
  258. Not all MOD effects can be reproduced in a MID file. Things that I have
  259. been able to reproduce include:
  260.   * Tempo (given that your MID player can handle a tempo-track)
  261.   * Note length (calculated from frequency, tempo, and # bytes in sample)
  262.   * Pattern Break
  263.   * Position Jump (well.. not really.. pretend its Pattern Break)
  264.   * Set Volume
  265.   * Note slides (slide up, slide down, slide to, fine-up, fine-down) all
  266.     implemented, but permanently in glissando mode.
  267.   * Arpeggio
  268.   * Volume Slides (and finevolume slides), but only if they occur at the
  269.     start of a note
  270.   * Set Sample Offset (actually retriggers the sample)
  271.   * Retrigger sample
  272.   * Cut sample
  273.   * Delay sample
  274.   * Pattern delay
  275. Effects that I have not been able to reproduce, or have ignored on the
  276. grounds that they are silly in a MID file are:
  277.   * Vibrato and Tremolo (not really possible to do nicely in a MID file)
  278.   * Position Jump (I have sort-of included it)
  279.   * Pattern Loop (dangerous.. can cause infinite loops.. MIDI doesn't
  280.       support loops so left it out)
  281.   * Set filter (an Amiga-only hardware effect)
  282.   * Set glissando (permanently on)
  283.   * Set vibrato/tremolo waveforms (no MIDI equivalent)
  284.   * Invert loop (*sigh* MIDI can't even come close to implementing this one)
  285. Hmm.. looking back at what I have included, it seems that MIDIMOD has more
  286. features than some mod-file players I have seen!
  287.  
  288. Source Code
  289. -----------
  290. I am distributing the source code - in fact, so must you! If MIDIMOD is
  291. placed on a publicly accessible medium (eg. BBS, FTP-site, Shareware vendor),
  292. then the source code must be there too. It must always be possible for the
  293. user to be able to modify this program. This allows multiple-platform
  294. distribution, allows everyone to add their little tweaks or use their
  295. favourite optimiser, and is even educational (if you can stand my code).
  296. It is legal to only possess the executable-code, but not to distribute
  297. only the executable. It is legal to distribute only the source code.
  298. For more information on the license, see the textfile also distributed with
  299. this package. Oh.. by the way.. if your computer crashes when running this
  300. program and you lose 3 years of hard work and gain white hair, don't blame
  301. me.. blame the power station, or the computer store, or your nextdoor
  302. neighbor. Details of who not to blame are also in the license.
  303.  
  304. The source code consists of two .c files and and two header files:
  305.   * midimod.c - main program
  306.   * midimod.h - header file for midimod.c
  307.   * textwin.c - text-windowing system I notched up because I didn't have one,
  308.        and because I wanted one for midimod. Hence it's rather incomplete.
  309.   * textwin.h - header file for textwin.c
  310. If you are creating an executable, make sure you link textwin with midimod.
  311. MIDIMOD was compiled on Turbo C 2.0, though it should work on any ANSI C
  312. compiler.. ignoring the IBM dependant console stuff of course.
  313.  
  314. How to get in touch
  315. -------------------
  316. You can email me on the internet at:
  317.   ascott@tartarus.uwa.edu.au
  318. I did have a FIDO-net address.. but I have forgotten it.. oh well.
  319. Snail-mail me at:
  320.   Andrew Scott
  321.   55 McCabe Street
  322.   Mosman Park
  323.   Western Australia,  6012
  324. Be warned.. I only speak English. Well.. I speak other languages as well..
  325. but not very good! (a joke.. a joke)
  326.